package jsyf.oa.entity.psi;

import com.alibaba.fastjson.JSONObject;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.xml.soap.SAAJResult;

import jsyf.oa.ientity.BaseEntity;

/**
 * Created by Maqiuqiu on 2018/10/17.
 */
@Entity
@Table(name = "t_psi_goods", schema = "oa", catalog = "")
public class GoodsEntity extends BaseEntity {

    private String name;
    private String unit;
    private String spec;
    private String unitPrice;
    private String description;
    private String image;
    private String remark;
    private String extra;
    private String extraInfo;
    private String createUserId;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getExtra() {
        return extra;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public String getSpec() {
        return spec;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public String getUnitPrice() {
        return unitPrice;
    }

    public void setUnitPrice(String unitPrice) {
        this.unitPrice = unitPrice;
    }

    public String getExtraInfo() {
        return extraInfo;
    }

    public void setExtraInfo(String extraInfo) {
        this.extraInfo = extraInfo;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", getId());
        obj.put("NAME", getName());
        obj.put("UNIT", getUnit());
        obj.put("SPEC", getSpec());
        obj.put("UNIT_PRICE", getUnitPrice());
        obj.put("DESCRIPTION", getDescription());
        obj.put("IMAGE", getImage());
        obj.put("REMARK", getRemark());
        obj.put("EXTRA", getExtra());
        obj.put("EXTRA_INFO", getExtraInfo());
        obj.put("CREATE_USER_ID", getCreateUserId());
        obj.put("CREATE_TIME", getCreateTime());
        obj.put("UPDATE_USER_ID", getUpdateUserId());
        obj.put("UPDATE_TIME", getUpdateTime());
        return obj;
    }

    @Override
    public String getTableName() {
        return "t_psi_goods";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("NAME", "name");
        obj.put("UNIT", "unit");
        obj.put("SPEC", "spec");
        obj.put("UNIT_PRICE", "unitPrice");
        obj.put("DESCRIPTION", "description");
        obj.put("IMAGE", "image");
        obj.put("REMARK", "remark");
        obj.put("EXTRA", "extra");
        obj.put("EXTRA_INFO", "extraInfo");
        obj.put("CREATE_USER_ID", "createUserId");
        obj.put("CREATE_TIME", "createTime");
        obj.put("UPDATE_USER_ID", "updateUserId");
        obj.put("UPDATE_TIME", "updateTime");
        return obj;
    }

}
